import Request from '@/utils/request.js'
let request = new Request().http
let hotelRequest = new Request('jiudian');

/**
 * 公寓门锁的接口 start
 */
// 查询锁数据
export function getlockList(data) {
	return request({
		url: '/lock/manage/getEmpowerLock',
		method: 'post',
		data
	})
}

// 获取门锁开锁命令(南湖门锁)
export function getOpenLockCmd(data) {
	return request({
		url: '/lock/unlockManage/unlock',
		method: 'post',
		data
	})
}

// 发送开锁信息
export function sendOpenRec(data) {
	return request({
		url: '/lock/unlockManage/reply',
		method: 'post',
		data
	})
}

// 添加门锁
export function addLock(data) {
	return request({
		url: '/lock/manage/addLock',
		method: 'post',
		data
	})
}

// 更新门锁 wifi
export function updateLock(data) {
	return request({
		url: '/lock/manage/updateLock',
		method: 'post',
		data
	})
}

// 编辑门锁名称
export function editLock(data) {
	return request({
		url: '/lock/manage/editLock',
		method: 'post',
		data
	})
}


// 查询数字密码
export function getGroupWifiLockPassword(data) {
	return request({
		url: '/lock/manage/getGroupWifiLockPassword',
		method: 'post',
		data
	})
}

// 配置数字密码
export function configGroupWifiLockPassword(data) {
	return request({
		url: '/lock/manage/configGroupWifiLockPassword',
		method: 'post',
		data
	})
}

//更新是否下发密码
export function updateSendPass(data) {
	return request({
		url: '/lock/manage/updateSendPass',
		method: 'post',
		data
	})
}

export function getUpgradeLockInfo(data) {
	return request({
		url: '/lock/manage/scanCodeUpgrade',
		method: 'post',
		data
	})
}


// 获取升级地址
export function getLatestUpgrade() {
	return request({
		url: '/lock/manage/getLatestUpgrade',
		method: 'post',
		data: {}
	})
}

// 将当前升级的新版本号 发送给后端
export function upgrageLockVersion(data) {
	return request({
		url: '/lock/manage/upgradeLockByBluetooth',
		method: 'post',
		data
	})
}

//锁升级成功上传后台
export function upgradeCallback(data) {
	return request({
		url: '/lock/manage/upgradeCallback',
		method: 'post',
		data
	})
}

//是否对房客展示密码
export function showPassword(data) {
	return request({
		url: '/lock/manage/showPassword',
		method: 'post',
		data
	})
}

// 获取升级报文
export function getLockUpgradeMessage(data) {
	return request({
		url: '/unlockManage/updateVerMsg',
		method: 'post',
		data
	})
}

/**
 * 公寓门锁的接口 end
 */


/**
 * 酒店门锁的接口 start
 */
export function getHotelLockList(data) {
	return hotelRequest.http({
		url: '/lock/hotel/getLockRoomList',
		method: 'post',
		data
	})
}


// 获取开锁报文
export function remoteOpenHotelLock(data) {
	return hotelRequest.http({
		url: '/lock/hotel/remoteOpenHotelLock',
		method: 'post',
		data
	})
}

// 上传开锁结果及报文
export function remoteOpenHotelLockReply(data) {
	return hotelRequest.http({
		url: '/lock/hotel/remoteOpenHotelLockReply',
		method: 'post',
		data
	})
}
/**
 * 酒店门锁的接口 end
 */

// 扫码远程开锁
export function openLockRemoteByScan(data) {
	return request({
		url: '/lock/manage/scanCodeUnlock',
		method: 'post',
		data
	})
}